const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,

  // 开发服务器代理配置
  devServer: {
    // 自动打开浏览器
    open: true,
    // 配置端口号
    port: 8081,
    // 配置代理，解决跨域问题
    proxy: {
      '/eduservice': {
        target: 'http://193.112.152.38:8001', // 目标服务器地址
        changeOrigin: true, // 是否改变源
      },
      '/eduoss': {
        target: 'http://193.112.152.38:8002',
        changeOrigin: true,
      },
      '/eduvod': {
        target: 'http://localhost:9001',
        changeOrigin: true,
        pathRewrite: { '^/eduvod': '' },
      },
      '/educms': {
        target: 'http://localhost:9001',
        changeOrigin: true,
        pathRewrite: { '^/educms': '' },
      },
      '/edumsm': {
        target: 'http://localhost:9001',
        changeOrigin: true,
        pathRewrite: { '^/edumsm': '' },
      },
      '/educenter': {
        target: 'http://localhost:9001',
        changeOrigin: true,
        pathRewrite: { '^/educenter': '' },
      },
      '/eduorder': {
        target: 'http://localhost:9001',
        changeOrigin: true,
        pathRewrite: { '^/eduorder': '' },
      }
    }
  }
})